﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.IO;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;
using System.Globalization;
using System.Threading;

namespace IDE_Week2_Solution
{
    public partial class Form1 : Form
    {
        public int a = 0;
        public Form1()
        {
            Thread.CurrentThread.CurrentUICulture = new CultureInfo("nl-NL");
            InitializeComponent();
            this.btchangelan.Text = "1";
        }

        private void btopen_Click(object sender, EventArgs e)
        {
            Form2 f2 = new Form2();
            f2.Show();
  
        }

        private void btchangeic_Click(object sender, EventArgs e)
        {

            this.Icon = new Icon(@"C:\Users\xiaheng\Desktop\IDE\Assignment2\IDE Week2 Solution\IDE Week2 Solution\Resources\ICON2.ico");
 
        }

        private void btreset_Click(object sender, EventArgs e)
        {

            this.Icon = new Icon(@"C:\Users\xiaheng\Desktop\IDE\Assignment2\IDE Week2 Solution\IDE Week2 Solution\Resources\form.ico");
 

        }
        private void Form1_Load(object sender, EventArgs e)
        {

        }
        private void ChangeLanguage(string lang)
        {
            foreach (Control c in this.Controls)
            {
                ComponentResourceManager resources =
                      new ComponentResourceManager(typeof(Form1));
                resources.ApplyResources(c, c.Name, new CultureInfo(lang));
            }
        }

        private void btchangelan_Click(object sender, EventArgs e)
        {

            if (a == 0)
            {
                ChangeLanguage("nl-NL");
                a = 1;
            }
            else
            {
                ChangeLanguage("en-GB");
                a = 0;
            }
        }

        private void btcall_Click(object sender, EventArgs e)
        {
            int[] numbers = new int[10];
            Class1.MakeRandomNumber(numbers);
            label1.Text = numbers[0] + ", " + numbers[1] + ", " + numbers[2];
        }

        
    
    }
}
